﻿using System;
using System.Linq;
using System.Drawing;

namespace funktionsPlotter
{
    class Y_Werte_kalkuliern : IY_Werte_kalkuliern
    {

        public Point[] y_Werte_generieren(Func<int, int> p_func, int[] p_max)
        {
            var p_erg = new Point[p_max.Length];
            var counter = 0;
            for (var x = p_max.Min(); x <= p_max.Max(); x++)
            {
                p_erg[counter].X = x;
                p_erg[counter].Y = p_func(x);
                counter++;
            }
            return p_erg;
        }
    }
}
